// throttle.ts
export function throttle<T extends (...args: any[]) => void>(func: T, wait: number) {
  let lastTime = 0
  return function (...args: Parameters<T>): void {
    const currentTime = Date.now()
    if (currentTime - lastTime >= wait) {
      lastTime = currentTime
      func(...args)
    }
  }
}
